1. Field of the Invention
The present invention relates generally to the data processing field and, more particularly, to a computer implemented method, system and computer program product for shrinking a file system in a data processing system.
2. Description of the Related Art
Shrinking of a file system in a data processing system is currently performed at the end of the file system. Thus, if files are located at the end of a file system, it is necessary to first move those files to another location toward the front of the file system in order to free up the space at the end of the file system, and then truncate the file system. Particularly in file systems that contain large amounts of data, this process can be inefficient and time consuming; and, potentially, also require the movement of metadata as well as user data.
Consider, for example, that the middle third of a file system is empty and the other two thirds of the file system are full. With current procedures for shrinking a file system, the allocations in the last third of the file system have to be moved to the empty middle third before the file system can be shrunk. In a 12 TB file system, it would be necessary to move 4 TB of data in order to shrink the file system.
It would, accordingly, be desirable to provide a mechanism for shrinking a file system in a data processing system that does not require movement of data from one location to another location in the file system.